package by.grsu.coctails.adapter;

import com.jfeinstein.jazzyviewpager.JazzyViewPager;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import by.grsu.coctails.fragments.ListCoctailFragment;
import by.grsu.coctails.fragments.ListIngredientFragment;
import by.grsu.coctails.fragments.MyCoctailsFragment;
import by.grsu.coctails.fragments.MyIngredientsFragment;

public class MainPagerAdapter extends CommonFragmentPagerAdapter {

	private JazzyViewPager mPager;

	public MainPagerAdapter(JazzyViewPager jazzyViewPager, FragmentManager fm, Context context) {
		super(fm, context);
		this.mPager = jazzyViewPager;
		initFragments();
	}

	public void initFragments() {
		Fragment fragment = new MyCoctailsFragment();
		getFragments().add(fragment);
		mPager.setObjectForPosition(fragment, 0);
		
		fragment = new MyIngredientsFragment();
		getFragments().add(fragment);
		mPager.setObjectForPosition(fragment, 1);
		
		fragment = new ListCoctailFragment();
		getFragments().add(fragment);
		mPager.setObjectForPosition(fragment, 2);
		
		fragment = new ListIngredientFragment(); 
		getFragments().add(fragment);
		mPager.setObjectForPosition(fragment, 3);
	}

	@Override
	public Integer getArrayTitles() {

		return null;
	}

}